home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Enigma Amiga CD
/
Listati
/
61-Febbraio-Esempio2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-02
|
3KB
|
72 lines
/*************************************************************************
* Secondo programma esempio di Impariamo a programmare l'Amiga (4) *
* creato da Giuseppe Ligorio *
* scopo: dimostrazione di compatibilita' con versioni inferiori alla 2.0 *
* mediante OpenScreen e ExtNewScreen *
*************************************************************************/
#define INTUI_V36_NAMES_ONLY
#include <exec/types.h>
#include <intuition/intuition.h>
#include <intuition/screens.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/intuition_protos.h>
/* puntatore alla base della librerie intuition.library */
struct Library *IntuitionBase;
void main()
{
struct Screen *schermo; /* puntatore allo schermo */
UWORD penne[] = { ~0 }; /* informazioni minime sulle penne per ottenere il look 3D */
char att[40]; /* stringa per l'attesa */
struct TagItem schermo_tags[2]; /* lista dei tag per attributi dello schermo */
struct ExtNewScreen nuovoschermo = /* struttura con parametri dello schermo */
{
0,0,640,256,2, /* LeftEdge,TopEdge,Width,Height,Depth */
0,1, /* DetailPen,BlockPen */
HIRES, /* ViewModes, alta risoluzione */
CUSTOMSCREEN|NS_EXTENDED, /* Type, schermo custom, struttura estesa */
NULL, /* Font */
"Secondo schermo.", /* Titolo */
NULL, /* Gadgets */
NULL, /* CustomBitMap */
NULL /* attributi per schermo 2.0, penne per look 3D */
};
/* apertura intuition.library qualsiasi versione */
if ((IntuitionBase = OpenLibrary("intuition.library",0L)) == NULL)
{
printf("Errore, non posso aprire libreria\n");
exit(0);
}
schermo_tags[0].ti_Tag = SA_Pens;
schermo_tags[0].ti_Data = (ULONG)penne;
schermo_tags[1].ti_Tag = TAG_DONE;
nuovoschermo.Extension = schermo_tags;
/* apertura schermo, se intuition.library e' inferiore alla 2.0 allora
lo schermo sara' 640x256x2 senza look 3D, altrimenti avra' anche il
look tridimensionale grazie all'attributo SA_Pens */
if ((schermo = OpenScreen((struct NewScreen *)&nuovoschermo)) == NULL)
{
printf("Errore, non posso aprire lo schermo\n");
CloseLibrary(IntuitionBase);
exit(0);
}
/* attesa inserimento stringa */
gets(att);
/* chiusura schermo e libreria */
CloseScreen(schermo);
CloseLibrary(IntuitionBase);
}